package com.atguigu.spring5.service.impl;

import com.atguigu.spring5.dao.IBookDao;
import com.atguigu.spring5.entity.Book;
import com.atguigu.spring5.service.IBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author : wenchao.long
 * @date : Created in 2020/10/30 8:51 周五
 * @description :
 */
@Service
public class BookServiceImpl implements IBookService {
    @Autowired
    private IBookDao bookDao;

    @Override
    public void insert(Book book) {
        bookDao.insert(book);
    }

    @Override
    public void update(Book book) {
        bookDao.update(book);
    }

    @Override
    public void delete(Long id) {
        bookDao.delete(id);
    }

    @Override
    public int count() {
        return bookDao.count();
    }

    @Override
    public Book getById(Long id) {
        return bookDao.getById(id);
    }

    @Override
    public List<Book> list() {
        return bookDao.list();
    }

    @Override
    public void saveBatch(List<Book> books) {
        bookDao.saveBatch(books);
    }

    @Override
    public void updateBatch(List<Book> books) {
        bookDao.updateBatch(books);
    }

    @Override
    public void deleteBatch(List<Long> ids) {
        bookDao.deleteBatch(ids);
    }
}
